﻿namespace MicroCloud.Options
{
    /// <summary>
    /// Swagger选项
    /// </summary>
    public class SwaggerOption
    {
        /// <summary>
        /// 获取或设置 界面样式：knife4j、swagger(默认)。
        /// </summary>
        public string UI { get; set; } = "swagger";

        /// <summary>
        /// 获取或设置 路由前缀
        /// </summary>
        public string RoutePrefix { get; set; } = "swagger";

        /// <summary>
        /// 获取或设置 是否隐藏架构
        /// </summary>
        public bool IsHideSchemas { get; set; } = false;

        /// <summary>
        /// 获取或设置 启用轻量级工具分析
        /// </summary>
        public bool MiniProfiler { get; set; } = true;

        /// <summary>
        /// 获取或设置 注释文档过滤规则
        /// </summary>
        public string XmlPattern { get; set; } = "*.xml";

        /// <summary>
        /// 获取或设置 分组集合
        /// </summary>
        public ICollection<SwaggerGroup> Groups { get; set; } = new List<SwaggerGroup>();

        /// <summary>
        /// 获取或设置 是否启用
        /// </summary>
        public bool Enabled { get; set; }

    }

    /// <summary>
    /// Swagger分组
    /// </summary>
    public class SwaggerGroup
    {
        /// <summary>
        /// 获取或设置 名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 获取或设置 标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 获取或设置 描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 获取或设置 Url
        /// </summary>
        public string Url { get; set; }

        /// <summary>
        /// 获取或设置 是否可见
        /// </summary>
        public bool? Visible { get; set; }
    }
}
